```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CPU性能优化指南 - 系统化排查与解决方案</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .section-card {
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .section-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .step-number {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            font-weight: 700;
            margin-right: 12px;
            flex-shrink: 0;
        }
        .tool-icon {
            color: #a777e3;
            font-size: 1.5rem;
            margin-right: 10px;
        }
        .highlight {
            position: relative;
            z-index: 1;
        }
        .highlight:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 30%;
            background-color: rgba(167, 119, 227, 0.2);
            z-index: -1;
            transition: height 0.3s ease;
        }
        .highlight:hover:after {
            height: 40%;
        }
        .command-box {
            font-family: 'Courier New', monospace;
            position: relative;
        }
        .command-box:before {
            content: '$';
            position: absolute;
            left: 12px;
            color: #a777e3;
            font-weight: bold;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4">
        <div class="max-w-5xl mx-auto">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">CPU性能优化指南</h1>
                    <p class="text-xl mb-8 opacity-90">系统化排查与解决方案</p>
                    <div class="bg-white bg-opacity-20 rounded-lg p-6 backdrop-filter backdrop-blur-sm">
                        <p class="italic">"排查CPU使用率飙高问题需要系统化的分析方法，结合工具和经验进行逐步诊断。最终的解决方案往往是多层次的，包括代码优化、系统配置调整和架构改进。"</p>
                    </div>
                </div>
                <div class="md:w-1/2">
                    <div class="mermaid">
                        graph TD
                            A[CPU使用率飙高] --> B[初步检查]
                            A --> C[确认高CPU进程]
                            A --> D[分析高CPU线程]
                            B --> E[系统资源监控]
                            C --> F[top/ps命令]
                            D --> G[jstack分析]
                            G --> H[代码问题]
                            H --> I[死循环/繁忙等待]
                            H --> J[锁竞争]
                            H --> K[频繁GC]
                            A --> L[系统级排查]
                            L --> M[I/O压力]
                            L --> N[内存压力]
                            L --> O[网络流量]
                            A --> P[外部依赖]
                            P --> Q[数据库查询]
                            P --> R[外部API]
                            A --> S[系统优化]
                            S --> T[硬件瓶颈]
                            S --> U[负载均衡]
                            S --> V[配置调整]
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <div class="max-w-5xl mx-auto px-4 py-12">
        <!-- Introduction -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8 section-card">
                <h2 class="text-2xl font-bold mb-6 text-gray-800 border-b pb-2">CPU问题排查方法论</h2>
                <p class="mb-6 text-gray-700">CPU使用率飙高是系统性能问题中最常见的症状之一，但背后的原因可能千差万别。本文提供一套完整的排查方法论，帮助您从现象到本质，逐步定位并解决CPU性能问题。</p>
                
                <div class="grid md:grid-cols-3 gap-6">
                    <div class="bg-gray-50 p-6 rounded-lg border border-gray-200">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-search tool-icon"></i>
                            <h3 class="text-lg font-semibold">全面诊断</h3>
                        </div>
                        <p class="text-gray-600">从系统监控到代码分析，覆盖所有可能的问题来源</p>
                    </div>
                    <div class="bg-gray-50 p-6 rounded-lg border border-gray-200">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-tools tool-icon"></i>
                            <h3 class="text-lg font-semibold">工具组合</h3>
                        </div>
                        <p class="text-gray-600">利用多种工具协同工作，提高问题定位效率</p>
                    </div>
                    <div class="bg-gray-50 p-6 rounded-lg border border-gray-200">
                        <div class="flex items-center mb-4">
                            <i class="fas fa-layer-group tool-icon"></i>
                            <h3 class="text-lg font-semibold">分层解决</h3>
                        </div>
                        <p class="text-gray-600">从代码到架构，提供不同层次的优化方案</p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Step 1 -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8 section-card">
                <div class="flex items-center mb-6">
                    <div class="step-number bg-purple-600 text-white">1</div>
                    <h2 class="text-2xl font-bold text-gray-800">初步检查与确认问题</h2>
                </div>
                
                <div class="space-y-6">
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-clipboard-check text-purple-600 mr-2"></i>
                            <span class="highlight">观察症状</span>
                        </h3>
                        <p class="text-gray-600 ml-8">首先确认问题的具体表现，比如系统响应变慢、某个服务处理能力下降等。同时查看是否是偶发性的CPU飙高，还是持续性的。</p>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-chart-line text-purple-600 mr-2"></i>
                            <span class="highlight">系统资源监控</span>
                        </h3>
                        <p class="text-gray-600 ml-8">通过<code class="bg-gray-100 px-2 py-1 rounded">top</code>、<code class="bg-gray-100 px-2 py-1 rounded">htop</code>、<code class="bg-gray-100 px-2 py-1 rounded">vmstat</code>等工具查看当前CPU的使用情况，确认是否有某个特定的进程或线程占用了大量的CPU资源。</p>
                        <div class="bg-gray-800 text-green-400 rounded-lg p-4 mt-3 overflow-x-auto command-box pl-8">
                            top -c<br>
                            htop<br>
                            vmstat 1 5
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Step 2 -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8 section-card">
                <div class="flex items-center mb-6">
                    <div class="step-number bg-purple-600 text-white">2</div>
                    <h2 class="text-2xl font-bold text-gray-800">确认高CPU消耗的进程</h2>
                </div>
                
                <div class="space-y-6">
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-terminal text-purple-600 mr-2"></i>
                            <span class="highlight">top命令</span>
                        </h3>
                        <p class="text-gray-600 ml-8">使用<code class="bg-gray-100 px-2 py-1 rounded">top</code>命令可以实时查看系统中各个进程的CPU使用情况。查看哪个进程的CPU占用率异常高。</p>
                        <div class="bg-gray-800 text-green-400 rounded-lg p-4 mt-3 overflow-x-auto command-box pl-8">
                            top<br>
                            # 按P键按CPU排序<br>
                            # 按M键按内存排序
                        </div>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-list-ol text-purple-600 mr-2"></i>
                            <span class="highlight">ps命令</span>
                        </h3>
                        <p class="text-gray-600 ml-8">可以结合<code class="bg-gray-100 px-2 py-1 rounded">ps -aux | sort -nrk 3</code>来列出所有进程，并按CPU使用率排序，进一步确认具体是哪个进程引发了问题。</p>
                        <div class="bg-gray-800 text-green-400 rounded-lg p-4 mt-3 overflow-x-auto command-box pl-8">
                            ps -aux | head -n 1  # 查看表头<br>
                            ps -aux | sort -nrk 3 | head -n 10  # 按CPU排序前10
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Step 3 -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8 section-card">
                <div class="flex items-center mb-6">
                    <div class="step-number bg-purple-600 text-white">3</div>
                    <h2 class="text-2xl font-bold text-gray-800">分析高CPU进程</h2>
                </div>
                
                <div class="space-y-6">
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-code-branch text-purple-600 mr-2"></i>
                            <span class="highlight">进程内线程分析</span>
                        </h3>
                        <p class="text-gray-600 ml-8">如果某个进程的CPU使用率特别高，可以使用<code class="bg-gray-100 px-2 py-1 rounded">top -H</code>命令查看该进程的每个线程的CPU使用情况。记录下高CPU使用率的线程ID（PID）。</p>
                        <div class="bg-gray-800 text-green-400 rounded-lg p-4 mt-3 overflow-x-auto command-box pl-8">
                            top -H -p [PID]  # 查看特定进程的线程
                        </div>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fab fa-java text-purple-600 mr-2"></i>
                            <span class="highlight">jstack分析（Java程序）</span>
                        </h3>
                        <p class="text-gray-600 ml-8">如果是Java应用程序，可以使用<code class="bg-gray-100 px-2 py-1 rounded">jstack</code>命令生成线程堆栈快照，结合<code class="bg-gray-100 px-2 py-1 rounded">top</code>命令记录的线程ID来分析具体是哪个线程引发了问题。</p>
                        <div class="bg-gray-800 text-green-400 rounded-lg p-4 mt-3 overflow-x-auto command-box pl-8">
                            # 将线程ID转换为十六进制<br>
                            printf "%x\n" [线程PID]<br><br>
                            # 生成线程堆栈<br>
                            jstack [Java进程PID] > thread_dump.log<br><br>
                            # 在thread_dump.log中搜索十六进制线程ID
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Step 4 -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8 section-card">
                <div class="flex items-center mb-6">
                    <div class="step-number bg-purple-600 text-white">4</div>
                    <h2 class="text-2xl font-bold text-gray-800">检查代码层面的问题</h2>
                </div>
                
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-sync-alt text-purple-600 mr-2"></i>
                            <span class="highlight">死循环或繁忙等待</span>
                        </h3>
                        <p class="text-gray-600 ml-8">高CPU使用通常与代码中存在死循环或繁忙等待有关，检查对应的线程堆栈，看看是否有明显的死循环或者无效的循环等待。</p>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-lock text-purple-600 mr-2"></i>
                            <span class="highlight">锁竞争</span>
                        </h3>
                        <p class="text-gray-600 ml-8">高CPU可能由线程间的锁竞争引发，导致大量线程处于忙等待状态。查看线程堆栈，确认是否有大量线程在等待锁资源。</p>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-trash-alt text-purple-600 mr-2"></i>
                            <span class="highlight">频繁GC（Java程序）</span>
                        </h3>
                        <p class="text-gray-600 ml-8">如果发现频繁的GC（垃圾回收）行为，也会导致CPU使用率飙高。通过<code class="bg-gray-100 px-2 py-1 rounded">jstat</code>工具可以监控GC的频率和时间。</p>
                        <div class="bg-gray-800 text-green-400 rounded-lg p-4 mt-3 overflow-x-auto command-box pl-8">
                            jstat -gcutil [PID] 1000  # 每秒监控一次GC情况
                        </div>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-code text-purple-600 mr-2"></i>
                            <span class="highlight">代码优化建议</span>
                        </h3>
                        <ul class="list-disc ml-8 text-gray-600 space-y-2">
                            <li>避免不必要的对象创建</li>
                            <li>优化算法复杂度</li>
                            <li>减少同步块范围</li>
                            <li>使用更高效的数据结构</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <!-- Step 5 -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8 section-card">
                <div class="flex items-center mb-6">
                    <div class="step-number bg-purple-600 text-white">5</div>
                    <h2 class="text-2xl font-bold text-gray-800">系统级问题排查</h2>
                </div>
                
                <div class="grid md:grid-cols-3 gap-6">
                    <div>
                        <h3 class="text-lg font-semibold mb-2 text-gray-700 flex items-center">
                            <i class="fas fa-hdd text-purple-600 mr-2"></i>
                            I/O压力
                        </h3>
                        <p class="text-gray-600 text-sm">有时候CPU高使用率与I/O压力相关，比如磁盘I/O、网络I/O等，检查系统的I/O状况，确认是否存在I/O瓶颈。</p>
                        <div class="bg-gray-800 text-green-400 rounded-lg p-3 mt-2 overflow-x-auto text-sm command-box pl-8">
                            iostat -x 1  # 查看磁盘I/O
                        </div>
                    </div>
                    
                    <div>
                        <h3 class="text-lg font-semibold mb-2 text-gray-700 flex items-center">
                            <i class="fas fa-memory text-purple-600 mr-2"></i>
                            内存压力
                        </h3>
                        <p class="text-gray-600 text-sm">高内存使用可能导致频繁的上下文切换或分页，影响CPU性能。使用<code class="bg-gray-100 px-1 py-0.5 rounded">free -m</code>、<code class="bg-gray-100 px-1 py-0.5 rounded">vmstat</code>等工具查看内存使用情况。</p>
                        <div class="bg-gray-800 text-green-400 rounded-lg p-3 mt-2 overflow-x-auto text-sm command-box pl-8">
                            free -m<br>
                            vmstat 1 5
                        </div>
                    </div>
                    
                    <div>
                        <h3 class="text-lg font-semibold mb-2 text-gray-700 flex items-center">
                            <i class="fas fa-network-wired text-purple-600 mr-2"></i>
                            网络流量
                        </h3>
                        <p class="text-gray-600 text-sm">如果网络流量激增，也会导致CPU处理负载增加，检查网络接口流量，确认是否有异常的网络活动。</p>
                        <div class="bg-gray-800 text-green-400 rounded-lg p-3 mt-2 overflow-x-auto text-sm command-box pl-8">
                            iftop  # 需要安装<br>
                            nethogs
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Step 6 -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8 section-card">
                <div class="flex items-center mb-6">
                    <div class="step-number bg-purple-600 text-white">6</div>
                    <h2 class="text-2xl font-bold text-gray-800">外部依赖排查</h2>
                </div>
                
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-database text-purple-600 mr-2"></i>
                            <span class="highlight">数据库查询问题</span>
                        </h3>
                        <p class="text-gray-600 ml-8">某些情况下，CPU飙高可能是由于复杂或低效的数据库查询导致的，检查应用程序的数据库操作日志。</p>
                        <div class="mt-4 ml-8">
                            <h4 class="font-medium text-gray-700 mb-2">排查方法：</h4>
                            <ul class="list-disc pl-5 space-y-1 text-gray-600">
                                <li>检查慢查询日志</li>
                                <li>分析执行计划</li>
                                <li>添加适当索引</li>
                                <li>优化SQL语句</li>
                            </ul>
                        </div>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-exchange-alt text-purple-600 mr-2"></i>
                            <span class="highlight">外部API调用</span>
                        </h3>
                        <p class="text-gray-600 ml-8">如果应用依赖外部API或服务，检查这些调用的响应时间，确认是否因为外部服务问题导致了应用的高CPU使用。</p>
                        <div class="mt-4 ml-8">
                            <h4 class="font-medium text-gray-700 mb-2">优化建议：</h4>
                            <ul class="list-disc pl-5 space-y-1 text-gray-600">
                                <li>增加超时设置</li>
                                <li>实现熔断机制</li>
                                <li>使用异步调用</li>
                                <li>添加缓存层</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Step 7 -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8 section-card">
                <div class="flex items-center mb-6">
                    <div class="step-number bg-purple-600 text-white">7</div>
                    <h2 class="text-2xl font-bold text-gray-800">系统级别优化</h2>
                </div>
                
                <div class="grid md:grid-cols-3 gap-6">
                    <div>
                        <h3 class="text-lg font-semibold mb-2 text-gray-700 flex items-center">
                            <i class="fas fa-microchip text-purple-600 mr-2"></i>
                            硬件瓶颈
                        </h3>
                        <p class="text-gray-600 text-sm">检查是否存在硬件上的瓶颈，比如CPU核心数不足、硬件故障等。考虑升级硬件或优化资源分配。</p>
                    </div>
                    
                    <div>
                        <h3 class="text-lg font-semibold mb-2 text-gray-700 flex items-center">
                            <i class="fas fa-balance-scale-right text-purple-600 mr-2"></i>
                            负载均衡
                        </h3>
                        <p class="text-gray-600 text-sm">如果单台服务器负载过高，可以考虑通过增加负载均衡器或水平扩展（增加更多实例）来分担压力。</p>
                    </div>
                    
                    <div>
                        <h3 class="text-lg font-semibold mb-2 text-gray-700 flex items-center">
                            <i class="fas fa-sliders-h text-purple-600 mr-2"></i>
                            配置调整
                        </h3>
                        <p class="text-gray-600 text-sm">检查应用的CPU亲和性配置，是否存在不合理的CPU绑定或资源分配问题。调整JVM参数、线程池大小等配置。</p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Step 8 -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8 section-card">
                <div class="flex items-center mb-6">
                    <div class="step-number bg-purple-600 text-white">8</div>
                    <h2 class="text-2xl font-bold text-gray-800">日志和监控数据分析</h2>
                </div>
                
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-file-alt text-purple-600 mr-2"></i>
                            <span class="highlight">日志分析</span>
                        </h3>
                        <p class="text-gray-600 ml-8">查看应用日志和系统日志，查找CPU飙高时段内的异常或错误记录。重点关注错误、警告和时间戳。</p>
                        <div class="bg-gray-800 text-green-400 rounded-lg p-4 mt-3 overflow-x-auto command-box pl-8">
                            grep -i "error\|warn\|exception" /var/log/app.log<br>
                            journalctl --since "1 hour ago"  # systemd系统
                        </div>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-chart-bar text-purple-600 mr-2"></i>
                            <span class="highlight">监控数据回溯</span>
                        </h3>
                        <p class="text-gray-600 ml-8">利用监控系统（如Prometheus、Grafana）回溯分析CPU飙高时的历史数据，查看是否有其他异常现象伴随出现。</p>
                        <div class="mt-4 ml-8">
                            <h4 class="font-medium text-gray-700 mb-2">关键指标：</h4>
                            <ul class="list-disc pl-5 space-y-1 text-gray-600">
                                <li>CPU使用率变化曲线</li>
                                <li>内存使用情况</li>
                                <li>磁盘I/O和网络流量</li>
                                <li>请求量和响应时间</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Step 9 -->
        <section class="mb-16">
            <div class="bg-white rounded-xl shadow-md p-8 section-card">
                <div class="flex items-center mb-6">
                    <div class="step-number bg-purple-600 text-white">9</div>
                    <h2 class="text-2xl font-bold text-gray-800">进一步调优与解决方案</h2>
                </div>
                
                <div class="space-y-8">
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-code text-purple-600 mr-2"></i>
                            <span class="highlight">代码优化</span>
                        </h3>
                        <p class="text-gray-600 ml-8">如果确定是某段代码引起了CPU的高占用，可以考虑优化代码逻辑，减少不必要的计算或循环。</p>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-tachometer-alt text-purple-600 mr-2"></i>
                            <span class="highlight">限流与降级</span>
                        </h3>
                        <p class="text-gray-600 ml-8">在压力过大时，可以通过限流、熔断和降级策略保护系统，减少过载对CPU的冲击。</p>
                        <div class="mt-4 ml-8">
                            <h4 class="font-medium text-gray-700 mb-2">常用策略：</h4>
                            <ul class="list-disc pl-5 space-y-1 text-gray-600">
                                <li>令牌桶限流</li>
                                <li>漏桶算法</li>
                                <li>熔断器模式</li>
                                <li>服务降级</li>
                            </ul>
                        </div>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-3 text-gray-700 flex items-center">
                            <i class="fas fa-project-diagram text-purple-600 mr-2"></i>
                            <span class="highlight">架构调整</span>
                        </h3>
                        <p class="text-gray-600 ml-8">如果是架构性问题，比如单点瓶颈，可以考虑进行架构调整，比如引入更优的任务调度机制、分布式处理等。</p>
                        <div class="mt-4 ml-8">
                            <h4 class="font-medium text-gray-700 mb-2">架构优化方向：</h4>
                            <ul class="list-disc pl-5 space-y-1 text-gray-600">
                                <li>微服务拆分</li>
                                <li>消息队列解耦</li>
                                <li>读写分离</li>
                                <li>缓存策略优化</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Summary -->
        <section class="mb-16">
            <div class="bg-purple-50 rounded-xl shadow-inner p-8 border border-purple-100">
                <h2 class="text-2xl font-bold mb-6 text-purple-800">CPU问题排查要点总结</h2>
                
                <div class="mermaid">
                    flowchart LR
                        A[CPU飙高] --> B[定位问题进程]
                        B --> C[分析线程堆栈]
                        C --> D[识别代码问题]
                        A --> E[检查系统资源]
                        E --> F[I/O/内存/网络]
                        A --> G[外部依赖检查]
                        G --> H[数据库/API]
                        D --> I[代码优化]
                        F --> J[系统调优]
                        H --> K[架构调整]
                </div>
                
                <div class="mt-8 grid md:grid-cols-2 gap-6">
                    <div>
                        <h3 class="text-lg font-semibold mb-3 text-purple-700">常用工具速查</h3>
                        <ul class="space-y-2">
                            <li class="flex items-start">
                                <span class="bg-purple-100 text-purple-800 px-2 py-1 rounded text-sm mr-2">top</span>
                                <span class="text-gray-700">进程监控</span>
                            </li>
                            <li class="flex items-start">
                                <span class="bg-purple-100 text-purple-800 px-2 py-1 rounded text-sm mr-2">jstack</span>
                                <span class="text-gray-700">Java线程分析</span>
                            </li>
                            <li class="flex items-start">
                                <span class="bg-purple-100 text-purple-800 px-2 py-1 rounded text-sm mr-2">vmstat</span>
                                <span class="text-gray-700">系统资源监控</span>
                            </li>
                            <li class="flex items-start">
                                <span class="bg-purple-100 text-purple-800 px-2 py-1 rounded text-sm mr-2">iostat</span>
                                <span class="text-gray-700">磁盘I/O分析</span>
                            </li>
                        </ul>
                    </div>
                    
                    <div>
                        <h3 class="text-lg font-semibold mb-3 text-purple-700">优化策略一览</h3>
                        <ul class="space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-600 mt-1 mr-2"></i>
                                <span class="text-gray-700">消除死循环和繁忙等待</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-600 mt-1 mr-2"></i>
                                <span class="text-gray-700">减少锁竞争</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-600 mt-1 mr-2"></i>
                                <span class="text-gray-700">优化GC策略</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-600 mt-1 mr-2"></i>
                                <span class="text-gray-700">引入缓存和异步处理</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
    </div>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-8 px-4">
        <div class="max-w-5xl mx-auto">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-semibold mb-2">技术小馆</h3>
                    <p class="text-gray-400">专业的系统性能优化指南</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-purple-300 hover:text-white transition-colors duration-200">
                        <i class="fas fa-globe mr-2"></i>
                        http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-6 text-center text-gray-500 text-sm">
                &copy; 2023 技术小馆. 保留所有权利.
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```